/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.jili.ubert.code.client2server;

import com.baidu.bjf.remoting.protobuf.Codec;
import com.baidu.bjf.remoting.protobuf.ProtobufProxy;
import com.baidu.bjf.remoting.protobuf.annotation.Protobuf;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

/**
 *
 * @author ChengJiLi
 */
public class BasketCancelOrders {
    @Protobuf
    private int cancelBasketID;
    @Protobuf
    private int basketTatol;
    @Protobuf
    private List<CancelOrder> cancelOrders;
    
    public byte[] EnCode(BasketCancelOrders msg) throws IOException{
        Codec<BasketCancelOrders> Lcode = ProtobufProxy.create(BasketCancelOrders.class);
        return Lcode.encode(msg);
    }
    public BasketCancelOrders DeCode(byte[] data) throws IOException{
        Codec<BasketCancelOrders> Lcode = ProtobufProxy.create(BasketCancelOrders.class);
        return Lcode.decode(data);
        
    }
    public BasketCancelOrders(){
        cancelOrders = new ArrayList<CancelOrder>();
        basketTatol = 0;
    }
    public BasketCancelOrders(List<CancelOrder> cancelOrders){
        this.cancelOrders = cancelOrders;
        this.basketTatol = cancelOrders.size();
    }
    public void AddCancelOrder(CancelOrder cancelOrder){
        this.cancelOrders.add(cancelOrder);
    }
    public void RemoveCancelOrder(CancelOrder cancelOrder){
        this.cancelOrders.remove(this);
    }
    public void RemoveCancelOrder(int i){
        this.cancelOrders.remove(i);
    }
    
    /**
     * @return the cancelBasketID
     */
    public int getCancelBasketID() {
        return cancelBasketID;
    }

    /**
     * @param cancelBasketID the cancelBasketID to set
     */
    public void setCancelBasketID(int cancelBasketID) {
        this.cancelBasketID = cancelBasketID;
    }

    /**
     * @return the basketTatol
     */
    public int getBasketTatol() {
        return basketTatol;
    }

    /**
     * @param basketTatol the basketTatol to set
     */
    public void setBasketTatol(int basketTatol) {
        this.basketTatol = basketTatol;
    }

    /**
     * @return the cancelOrders
     */
    public List<CancelOrder> getCancelOrders() {
        return cancelOrders;
    }

    /**
     * @param cancelOrders the cancelOrders to set
     */
    public void setCancelOrders(List<CancelOrder> cancelOrders) {
        this.cancelOrders = cancelOrders;
    }

}
